<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>农技电子杂志订阅</title>
		<script src="__INDEX__/tem/js/mui.min.js"></script>
	<link href="__INDEX__/tem/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="__INDEX__/tem/css/style.css" />
	<link rel="stylesheet" href="__INDEX__/tem/css/iconfont.css" />
	<link rel="stylesheet" href="__INDEX__/tem/css/xn.css" />
		<link rel="stylesheet" href="__CSS__/mall.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"  id="return"></a>
			    <h1 class="mui-title">农技电子杂志订阅</h1>
			</header>
		<div class="mui-content">
			<div class="gerenzl_nr">
				<form id="myForm" class="mui-input-group quer_input_group" action="{:url('member/dingyue')}" method="post">
					<div class="mui-input-row">
						<b style="color: red;">
							{if $ddd > 0}
							已订阅，还有{$ddd}天到期，到期后才可以订阅。
							{else /}
							未订阅
							{/if}
						</b>
					</div>
					<div class="ordpj_listbox">
						<div class="ordpj_lisitem">
							<label><input type="radio" name="num" value="0.01" checked="checked" onclick="checkAll()"> 25元/月/大类
								<del style="margin-left: 50px; color: red;"></del></label>
						</div>
						<div class="ordpj_lisitem">
							<label><input type="radio" name="num" value="70" onclick="checkAll()"> 70元/3月/大类
								<del style="margin-left: 50px; color: red;">75元/3月/大类</del></label>
						</div>
						<div class="ordpj_lisitem">
							<label><input type="radio" name="num" value="120" onclick="checkAll()"> 120元/半年/大类
								<del style="margin-left: 50px; color: red;">150元/半年/大类</del></label>
						</div>
						<div class="ordpj_lisitem">
							<label><input type="radio" name="num" value="200" onclick="checkAll()"> 200元/1年/大类
								<del style="margin-left: 50px; color: red;">200元/1年/大类</del></label>
						</div>
					</div>
					<h1 style="font-size: 18px;padding: 10px;">分类</h1> {foreach name='cate' item='vo'}
					<div class="mui-input-row">
						<span style="border: #009900 1px solid;color: #009900;padding:0 3px; margin-right: 8px;">
							<input type="checkbox" name="yuetype1[]" onclick="checkAll('{$vo.id}')" class="fans" id="fanss{$vo.id}" value="{$vo.id}" {if in_array($vo.id,$user.yuetype1)}checked{/if}/>
							<label for="fanss{$vo.id}" style="float: inherit;height: 30px;line-height: 30px;">{$vo.name}</label>
						</span>
						{foreach name='vo.note' item='vo2'}
						<div style="display: inline-block;margin-right: 15px; ">
							<input style="display: none;" type="checkbox" name="yuetype[]" id="fans{$vo2.id}" onclick="bb('{$vo.id}')" class="fans{$vo.id}" value="{$vo2.id}" {if in_array($vo2.id,$user.yuetype)}checked{/if}/>
							<label for="fans{$vo2.id}" style="float: inherit;height: 30px;line-height: 30px;">{$vo2.name}</label>
						</div>
						{/foreach}
					</div>
					{/foreach}
					<ul class="quer_infolis">
						<li class="clearfix">
							<span class="left">付款方式</span>
							<span class="right fkfs"  id="wx"><em class="iconfont icon-wechat"></em>微信</span>
							<span class="right fkfs"  id="ali"><em class="iconfont icon-wechat"></em>支付宝</span>
						</li>
					</ul>
					<div class="ordpj_nrbox" style="padding-bottom: 30px;">
						<div class="ordpj_scimg clearfix">
							<div class="bt">会员福利：</div>
							<div class="ordpj_imgbox">
								1、享受普通会员一切福利<br> 
								2、年费会员享受免费一次产品品牌包装服务
								<br> 3、年费会员享受统一对外销售服务
								<br> 4、年费会员免费享受一次项目申报拟写文件服务
								<br> 5、免费查询周边农民工信息服务
								<br> 6、免费享受专家在线技术指导服务
								<br> 7、免费享受农业情报站最新情报信息推送服务（市场行情情报、政策情报、技术情报、生活信息）
							</div>
						</div>
					</div>
				
			</div>
		</div>
		<div class="qrdd_bnavbox">
			
				{if $ddd <= 0}
				<div class="gwc_bnav">
				<input type="hidden" name="total" id="total" value="" />
				<input type="hidden" id="pay_type" name="pay_type" value="" />
				<div class="gwc_zjpri">合计：¥<em id="total_money">0</em></div>
				<button type="button" class="gwc_bbtn"  onclick="doSubmit()">确认购买</button>
				</div>
				{/if}
			
		</div>
		</form>
	</body>

</html>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/jquery.validate.min.js"></script>
<script src="__LIB__/layer.js"></script>
<script src="__JS__/index.js"></script>
<script type="text/javascript">
	$("#return").click(function() {
		location.href = "{:url('member/index')}";
	});
	function bb($id){
		 document.getElementById('fanss'+$id).checked=true;
		}

	checkAll();
	function checkAll($id){
        //所有的input标签
        var inputs = document.getElementsByClassName('fans'+$id);
        for (var i = 0; i < inputs.length; i++) {
            //判断当前的对象是不是input对象，是不是checkbox
            if (inputs[i].type == "checkbox") {
                inputs[i].checked = event.srcElement.checked;
            }
        }
		
	    var checks = document.getElementsByName("yuetype1[]");
	    n = 0;
	    for(i=0;i<checks.length;i++){
	        if(checks[i].checked)
	            n++;
	    }
	    $("#total_money").html($('input:radio[name="num"]:checked').val()*n);
	    $("#total").val($('input:radio[name="num"]:checked').val()*n);
	    
	    
	}
	var ua = window.navigator.userAgent.toLowerCase(); 
    if (ua.match(/MicroMessenger/i) == 'micromessenger') { 
    	$("#ali").hide();
    	$("#wx").show();
    	$("#pay_type").val('2')
    } else { 
    	$("#wx").hide();
    	$("#ali").show();
    	$("#pay_type").val('3')
    } 
	function doSubmit() {
		$("#myForm").submit();
	}
	
    
</script>